/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package GameModel;

import GameModel.Helper.GameModelUtils;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Board</b></em>'.
 * <!-- end-user-doc -->
 *
 * <p>
 * The following features are supported:
 * <ul>
 *   <li>{@link GameModel.Board#getSelectedField <em>Selected Field</em>}</li>
 *   <li>{@link GameModel.Board#getFields <em>Fields</em>}</li>
 *   <li>{@link GameModel.Board#getHeight <em>Height</em>}</li>
 *   <li>{@link GameModel.Board#getWidth <em>Width</em>}</li>
 * </ul>
 * </p>
 *
 * @see GameModel.GameModelPackage#getBoard()
 * @model
 * @generated
 */
public interface Board extends EObject {
	/**
	 * Returns the value of the '<em><b>Selected Field</b></em>' reference.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Selected Field</em>' reference isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Selected Field</em>' reference.
	 * @see #setSelectedField(Field)
	 * @see GameModel.GameModelPackage#getBoard_SelectedField()
	 * @model
	 * @generated
	 */
	Field getSelectedField();

	/**
	 * Sets the value of the '{@link GameModel.Board#getSelectedField <em>Selected Field</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Selected Field</em>' reference.
	 * @see #getSelectedField()
	 * @generated
	 */
	void setSelectedField(Field value);

	/**
	 * Returns the value of the '<em><b>Fields</b></em>' containment reference list.
	 * The list contents are of type {@link GameModel.Field}.
	 * It is bidirectional and its opposite is '{@link GameModel.Field#getBoard <em>Board</em>}'.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Fields</em>' containment reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Fields</em>' containment reference list.
	 * @see GameModel.GameModelPackage#getBoard_Fields()
	 * @see GameModel.Field#getBoard
	 * @model opposite="board" containment="true"
	 * @generated
	 */
	EList<Field> getFields();

	/**
	 * Returns the value of the '<em><b>Height</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Height</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Height</em>' attribute.
	 * @see #setHeight(int)
	 * @see GameModel.GameModelPackage#getBoard_Height()
	 * @model ordered="false"
	 * @generated
	 */
	int getHeight();

	/**
	 * Sets the value of the '{@link GameModel.Board#getHeight <em>Height</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Height</em>' attribute.
	 * @see #getHeight()
	 * @generated
	 */
	void setHeight(int value);

	/**
	 * Returns the value of the '<em><b>Width</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Width</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Width</em>' attribute.
	 * @see #setWidth(int)
	 * @see GameModel.GameModelPackage#getBoard_Width()
	 * @model required="true" ordered="false"
	 * @generated
	 */
	int getWidth();

	/**
	 * Sets the value of the '{@link GameModel.Board#getWidth <em>Width</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Width</em>' attribute.
	 * @see #getWidth()
	 * @generated
	 */
	void setWidth(int value);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model annotation="SDM XMI='<?xml version=\"1.0\" encoding=\"ASCII\"?>\r\n<SDMLanguage.activities:Activity xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\" xmlns:SDMLanguage.activities=\"http://www.moflon.org/SDMLanguage.activities\" xmlns:SDMLanguage.expressions=\"http://www.moflon.org/SDMLanguage.expressions\" xmlns:SDMLanguage.patterns=\"http://www.moflon.org/SDMLanguage.patterns\" xmlns:SDMLanguage.patterns.patternExpressions=\"http://www.moflon.org/SDMLanguage.patterns.patternExpressions\" xmlns:SDMLanguage.calls.callExpressions=\"http://www.moflon.org/SDMLanguage.calls.callExpressions\" xmlns:SDMLanguage.calls=\"http://www.moflon.org/SDMLanguage.calls\" xsi:schemaLocation=\"http://www.moflon.org/SDMLanguage.activities SDMLanguage.ecore#//activities http://www.moflon.org/SDMLanguage.patterns SDMLanguage.ecore#//patterns\" owningOperation=\"http://www.moflon.org/GameModel#//Board/initialize\">\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StartNode\" outgoing=\"#//@ownedActivityEdge.0 \" name=\"Board::initialize (utils: GameModelUtils, boardHeight: EInt, boardWidth: EInt): Board\" />\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.1\" source=\"#//@ownedActivityNode.0\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.1 \" incoming=\"#//@ownedActivityEdge.0 \" name=\"CreateNewBoard\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" name=\"this\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Board\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.4\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.2 \" incoming=\"#//@ownedActivityEdge.3 \" name=\"ActivityNode2\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.2 #//@ownedActivityNode.2/@storyPattern/@linkVariable.5 #//@ownedActivityNode.2/@storyPattern/@linkVariable.7 \" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.0 #//@ownedActivityNode.2/@storyPattern/@linkVariable.1 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Board\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.2\" name=\"board\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.3\" name=\"board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.3 #//@ownedActivityNode.2/@storyPattern/@linkVariable.4 #//@ownedActivityNode.2/@storyPattern/@linkVariable.6 #//@ownedActivityNode.2/@storyPattern/@linkVariable.8 \" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.2 \" name=\"newField\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" name=\"fields\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.0 \" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.3 \" name=\"left\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/GameModel#//Field/x\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.2\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"newField.getX() - 1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/GameModel#//Field/y\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.2\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"newField.getY()\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.2\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" name=\"left\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.1 \" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.4 \" name=\"right\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/GameModel#//Field/x\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.3\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"newField.getX() + 1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/GameModel#//Field/y\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.3\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"newField.getY()\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.3\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" name=\"right\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.5 #//@ownedActivityNode.2/@storyPattern/@linkVariable.6 \" name=\"bottom\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/GameModel#//Field/x\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.4\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"newField.getX()\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/GameModel#//Field/y\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.4\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"newField.getY() + 1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.4\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" name=\"fields\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.4\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" name=\"bottom\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.7 #//@ownedActivityNode.2/@storyPattern/@linkVariable.8 \" name=\"top\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/GameModel#//Field/x\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.5\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"newField.getX()\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/GameModel#//Field/y\" object=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.5\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"newField.getY() - 1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.5\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" name=\"fields\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.5\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" name=\"top\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.2\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"true\" outgoing=\"#//@ownedActivityEdge.3 #//@ownedActivityEdge.4 \" incoming=\"#//@ownedActivityEdge.5 #//@ownedActivityEdge.2 \" name=\"ActivityNode4\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" incomingLink=\"#//@ownedActivityNode.3/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Board\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.0\" source=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.1\" name=\"board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.3/@storyPattern/@linkVariable.0 \" name=\"fields\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"EACH_TIME\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityEdge guard=\"END\" target=\"#//@ownedActivityNode.5\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StatementNode\" outgoing=\"#//@ownedActivityEdge.5 \" incoming=\"#//@ownedActivityEdge.1 \" name=\"ActivityNode5\">\r\n    <statementExpression xsi:type=\"SDMLanguage.calls.callExpressions:MethodCallExpression\" callee=\"http://www.moflon.org/GameModel#//Helper/GameModelUtils/addAllFields\">\r\n      <ownedParameterBindings parameter=\"http://www.moflon.org/GameModel#//Helper/GameModelUtils/addAllFields/board\">\r\n        <valueExpression xsi:type=\"SDMLanguage.expressions:TextualExpression\" expressionText=\"this\" />\r\n      </ownedParameterBindings>\r\n      <target xsi:type=\"SDMLanguage.calls.callExpressions:ParameterExpression\" parameter=\"http://www.moflon.org/GameModel#//Board/initialize/utils\" />\r\n    </statementExpression>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.4\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StopNode\" incoming=\"#//@ownedActivityEdge.4 \" name=\"this\">\r\n    <returnValue xsi:type=\"SDMLanguage.patterns.patternExpressions:ObjectVariableExpression\" object=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.0\" />\r\n  </ownedActivityNode>\r\n</SDMLanguage.activities:Activity>'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean fujaba__Success = false;\n      Iterator fujaba__IterThisToBottom = null;\n      Field bottom = null;\n      Iterator fujaba__IterThisToLeft = null;\n      Field left = null;\n      Iterator fujaba__IterThisToRight = null;\n      Field right = null;\n      Iterator fujaba__IterThisToTop = null;\n      Field top = null;\n      Iterator fujaba__IterThisToNewField = null;\n      Field newField = null;\n      Iterator fujaba__IterThisToFields = null;\n      Field fields = null;\n\n      utils.addAllFields(this);\n      // story pattern ActivityNode4\n      try \n      {\n         fujaba__Success = false; \n\n         // iterate to-many link fields from this to fields\n         fujaba__Success = false;\n\n         fujaba__IterThisToFields = new ArrayList(this.getFields()).iterator ();\n\n         while ( fujaba__IterThisToFields.hasNext () )\n         {\n            try\n            {\n               fields = (Field) fujaba__IterThisToFields.next ();\n\n               // check object fields is really bound\n               JavaSDM.ensure ( fields != null );\n               // story pattern ActivityNode2\n               try \n               {\n                  fujaba__Success = false; \n\n                  // iterate to-many link fields from this to newField\n                  fujaba__Success = false;\n\n                  fujaba__IterThisToNewField = this.getFields().iterator ();\n\n                  while ( !(fujaba__Success) && fujaba__IterThisToNewField.hasNext () )\n                  {\n                     try\n                     {\n                        newField = (Field) fujaba__IterThisToNewField.next ();\n\n                        // check object newField is really bound\n                        JavaSDM.ensure ( newField != null );\n                        // iterate to-many link fields from this to bottom\n                        fujaba__Success = false;\n\n                        fujaba__IterThisToBottom = this.getFields().iterator ();\n\n                        while ( !(fujaba__Success) && fujaba__IterThisToBottom.hasNext () )\n                        {\n                           try\n                           {\n                              bottom = (Field) fujaba__IterThisToBottom.next ();\n\n                              // check optional\n                              if (bottom != null)\n                              {\n                                 // check isomorphic binding between objects bottom and newField\n                                 JavaSDM.ensure ( !bottom.equals (newField) );\n\n                                 // attribute condition\n                                 JavaSDM.ensure ( bottom.getX () == newField.getX() );\n\n                                 // attribute condition\n                                 JavaSDM.ensure ( bottom.getY () == newField.getY() + 1 );\n\n                              }\n                              fujaba__Success = true;\n                           }\n                           catch ( JavaSDMException fujaba__InternalException )\n                           {\n                              fujaba__Success = false;\n                           }\n                        }\n                        if (!fujaba__Success)\n                        {\n                           fujaba__Success = true;\n                           bottom = null;\n                        }\n                        // iterate to-many link fields from this to left\n                        fujaba__Success = false;\n\n                        fujaba__IterThisToLeft = this.getFields().iterator ();\n\n                        while ( !(fujaba__Success) && fujaba__IterThisToLeft.hasNext () )\n                        {\n                           try\n                           {\n                              left = (Field) fujaba__IterThisToLeft.next ();\n\n                              // check optional\n                              if (left != null)\n                              {\n                                 // check isomorphic binding between objects left and newField\n                                 JavaSDM.ensure ( !left.equals (newField) );\n\n                                 // attribute condition\n                                 JavaSDM.ensure ( left.getX () == newField.getX() - 1 );\n\n                                 // attribute condition\n                                 JavaSDM.ensure ( left.getY () == newField.getY() );\n\n                              }\n                              fujaba__Success = true;\n                           }\n                           catch ( JavaSDMException fujaba__InternalException )\n                           {\n                              fujaba__Success = false;\n                           }\n                        }\n                        if (!fujaba__Success)\n                        {\n                           fujaba__Success = true;\n                           left = null;\n                        }\n                        // iterate to-many link fields from this to right\n                        fujaba__Success = false;\n\n                        fujaba__IterThisToRight = this.getFields().iterator ();\n\n                        while ( !(fujaba__Success) && fujaba__IterThisToRight.hasNext () )\n                        {\n                           try\n                           {\n                              right = (Field) fujaba__IterThisToRight.next ();\n\n                              // check optional\n                              if (right != null)\n                              {\n                                 // check isomorphic binding between objects right and newField\n                                 JavaSDM.ensure ( !right.equals (newField) );\n\n                                 // attribute condition\n                                 JavaSDM.ensure ( right.getX () == newField.getX() + 1 );\n\n                                 // attribute condition\n                                 JavaSDM.ensure ( right.getY () == newField.getY() );\n\n                              }\n                              fujaba__Success = true;\n                           }\n                           catch ( JavaSDMException fujaba__InternalException )\n                           {\n                              fujaba__Success = false;\n                           }\n                        }\n                        if (!fujaba__Success)\n                        {\n                           fujaba__Success = true;\n                           right = null;\n                        }\n                        // iterate to-many link fields from this to top\n                        fujaba__Success = false;\n\n                        fujaba__IterThisToTop = this.getFields().iterator ();\n\n                        while ( !(fujaba__Success) && fujaba__IterThisToTop.hasNext () )\n                        {\n                           try\n                           {\n                              top = (Field) fujaba__IterThisToTop.next ();\n\n                              // check optional\n                              if (top != null)\n                              {\n                                 // check isomorphic binding between objects top and newField\n                                 JavaSDM.ensure ( !top.equals (newField) );\n\n                                 // attribute condition\n                                 JavaSDM.ensure ( top.getX () == newField.getX() );\n\n                                 // attribute condition\n                                 JavaSDM.ensure ( top.getY () == newField.getY() - 1 );\n\n                              }\n                              fujaba__Success = true;\n                           }\n                           catch ( JavaSDMException fujaba__InternalException )\n                           {\n                              fujaba__Success = false;\n                           }\n                        }\n                        if (!fujaba__Success)\n                        {\n                           fujaba__Success = true;\n                           top = null;\n                        }\n\n                        fujaba__Success = true;\n                     }\n                     catch ( JavaSDMException fujaba__InternalException )\n                     {\n                        fujaba__Success = false;\n                     }\n                  }\n                  JavaSDM.ensure (fujaba__Success);\n                  // check optional\n                  if (right != null)\n                  {\n                     // create link\n                     org.moflon.util.eMoflonEMFUtil.addOppositeReference(newField,right,\"right\");\n                  }// check optional\n                  if (bottom != null)\n                  {\n                     // create link\n                     org.moflon.util.eMoflonEMFUtil.addOppositeReference(newField,bottom,\"bottom\");\n                  }// check optional\n                  if (left != null)\n                  {\n                     // create link\n                     org.moflon.util.eMoflonEMFUtil.addOppositeReference(newField,left,\"left\");\n                  }// check optional\n                  if (top != null)\n                  {\n                     // create link\n                     org.moflon.util.eMoflonEMFUtil.addOppositeReference(newField,top,\"top\");\n                  }   fujaba__Success = true;\n               }\n               catch ( JavaSDMException fujaba__InternalException )\n               {\n                  fujaba__Success = false;\n               }\n\n\n               fujaba__Success = true;\n            }\n            catch ( JavaSDMException fujaba__InternalException )\n            {\n               fujaba__Success = false;\n            }\n         }\n         JavaSDM.ensure (fujaba__Success);\n         fujaba__Success = true;\n      }\n      catch ( JavaSDMException fujaba__InternalException )\n      {\n         fujaba__Success = false;\n      }\n\n      return this;'"
	 * @generated
	 */
	Board initialize(GameModelUtils utils, int boardHeight, int boardWidth);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model kind="operation"
	 *        annotation="SDM XMI='<?xml version=\"1.0\" encoding=\"ASCII\"?>\r\n<SDMLanguage.activities:Activity xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\" xmlns:SDMLanguage.activities=\"http://www.moflon.org/SDMLanguage.activities\" xmlns:SDMLanguage.expressions=\"http://www.moflon.org/SDMLanguage.expressions\" xmlns:SDMLanguage.patterns=\"http://www.moflon.org/SDMLanguage.patterns\" xmlns:SDMLanguage.patterns.patternExpressions=\"http://www.moflon.org/SDMLanguage.patterns.patternExpressions\" xmlns:SDMLanguage.calls.callExpressions=\"http://www.moflon.org/SDMLanguage.calls.callExpressions\" xmlns:SDMLanguage.calls=\"http://www.moflon.org/SDMLanguage.calls\" xsi:schemaLocation=\"http://www.moflon.org/SDMLanguage.activities SDMLanguage.ecore#//activities http://www.moflon.org/SDMLanguage.patterns SDMLanguage.ecore#//patterns\" owningOperation=\"http://www.moflon.org/GameModel#//Board/getBoardSize\">\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StartNode\" outgoing=\"#//@ownedActivityEdge.0 \" name=\"Board::getBoardSize (): EInt\" />\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.1\" source=\"#//@ownedActivityNode.0\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.1 \" incoming=\"#//@ownedActivityEdge.0 \" name=\"ActivityNode3\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" name=\"this\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Board\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StopNode\" incoming=\"#//@ownedActivityEdge.1 \" name=\"this.height + this.width\">\r\n    <returnValue xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"this.height + this.width\" />\r\n  </ownedActivityNode>\r\n</SDMLanguage.activities:Activity>'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean fujaba__Success = false;\n\n      return this.height + this.width;'"
	 * @generated
	 */
	int getBoardSize();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model annotation="SDM XMI='<?xml version=\"1.0\" encoding=\"ASCII\"?>\r\n<SDMLanguage.activities:Activity xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\" xmlns:SDMLanguage.activities=\"http://www.moflon.org/SDMLanguage.activities\" xmlns:SDMLanguage.expressions=\"http://www.moflon.org/SDMLanguage.expressions\" xmlns:SDMLanguage.patterns=\"http://www.moflon.org/SDMLanguage.patterns\" xmlns:SDMLanguage.patterns.patternExpressions=\"http://www.moflon.org/SDMLanguage.patterns.patternExpressions\" xmlns:SDMLanguage.calls.callExpressions=\"http://www.moflon.org/SDMLanguage.calls.callExpressions\" xmlns:SDMLanguage.calls=\"http://www.moflon.org/SDMLanguage.calls\" xsi:schemaLocation=\"http://www.moflon.org/SDMLanguage.activities SDMLanguage.ecore#//activities http://www.moflon.org/SDMLanguage.patterns SDMLanguage.ecore#//patterns\" owningOperation=\"http://www.moflon.org/GameModel#//Board/fieldSelected\">\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StartNode\" outgoing=\"#//@ownedActivityEdge.0 \" name=\"Board::fieldSelected (field: Field): Board\" />\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.4\" source=\"#//@ownedActivityNode.0\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.1 \" incoming=\"#//@ownedActivityEdge.3 \" name=\"ActivityNode8\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" incomingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.0 \" name=\"field\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.0\" source=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.1\" name=\"field\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.0 \" name=\"figure\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Figure\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StopNode\" incoming=\"#//@ownedActivityEdge.2 #//@ownedActivityEdge.7 \" name=\"this\">\r\n    <returnValue xsi:type=\"SDMLanguage.patterns.patternExpressions:ObjectVariableExpression\" object=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.0\" />\r\n  </ownedActivityNode>\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.2 \" incoming=\"#//@ownedActivityEdge.1 \" name=\"ActivityNode9\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.3/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" incomingLink=\"#//@ownedActivityNode.3/@storyPattern/@linkVariable.0 \" name=\"field\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.0\" name=\"selectedField\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.3 #//@ownedActivityEdge.4 \" incoming=\"#//@ownedActivityEdge.0 \" name=\"ActivityNode10\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.0 \" name=\"selField\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.0\" name=\"selectedField\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"FAILURE\" target=\"#//@ownedActivityNode.1\" source=\"#//@ownedActivityNode.4\" />\r\n  <ownedActivityEdge guard=\"SUCCESS\" target=\"#//@ownedActivityNode.5\" source=\"#//@ownedActivityNode.4\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.5 \" incoming=\"#//@ownedActivityEdge.4 \" name=\"ActivityNode11\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" incomingLink=\"#//@ownedActivityNode.5/@storyPattern/@linkVariable.0 \" name=\"selField\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.5/@storyPattern/@objectVariable.0\" source=\"#//@ownedActivityNode.5/@storyPattern/@objectVariable.1\" name=\"field\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.5/@storyPattern/@linkVariable.0 \" name=\"selFigure\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Figure\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.6\" source=\"#//@ownedActivityNode.5\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StatementNode\" outgoing=\"#//@ownedActivityEdge.6 \" incoming=\"#//@ownedActivityEdge.5 \" name=\"CallMoveMethod\">\r\n    <statementExpression xsi:type=\"SDMLanguage.calls.callExpressions:MethodCallExpression\" callee=\"http://www.moflon.org/GameModel#//Figure/moveTo\">\r\n      <ownedParameterBindings parameter=\"http://www.moflon.org/GameModel#//Figure/moveTo/to\">\r\n        <valueExpression xsi:type=\"SDMLanguage.expressions:TextualExpression\" expressionText=\"field\" />\r\n      </ownedParameterBindings>\r\n      <target xsi:type=\"SDMLanguage.patterns.patternExpressions:ObjectVariableExpression\" object=\"#//@ownedActivityNode.5/@storyPattern/@objectVariable.1\" />\r\n    </statementExpression>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.7\" source=\"#//@ownedActivityNode.6\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.7 \" incoming=\"#//@ownedActivityEdge.6 \" name=\"ActivityNode13\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.7/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" incomingLink=\"#//@ownedActivityNode.7/@storyPattern/@linkVariable.0 \" name=\"selField\" type=\"ecore:EClass http://www.moflon.org/GameModel#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"DESTROY\" target=\"#//@ownedActivityNode.7/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.7/@storyPattern/@objectVariable.0\" name=\"selectedField\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.7\" />\r\n</SDMLanguage.activities:Activity>'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean fujaba__Success = false;\n      Field selField = null;\n      Figure selFigure = null;\n      Figure figure = null;\n\n      // story pattern ActivityNode10\n      try \n      {\n         fujaba__Success = false; \n\n         // bind object\n         selField = this.getSelectedField ();\n\n         // check object selField is really bound\n         JavaSDM.ensure ( selField != null );\n\n\n         fujaba__Success = true;\n      }\n      catch ( JavaSDMException fujaba__InternalException )\n      {\n         fujaba__Success = false;\n      }\n\n      if (fujaba__Success)\n      {\n         // story pattern ActivityNode11\n         try \n         {\n            fujaba__Success = false; \n\n            // check object selField is really bound\n            JavaSDM.ensure ( selField != null );\n            // bind object\n            selFigure = selField.getFigure ();\n\n            // check object selFigure is really bound\n            JavaSDM.ensure ( selFigure != null );\n\n\n            fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n         selFigure.moveTo(field);\n         // story pattern ActivityNode13\n         try \n         {\n            fujaba__Success = false; \n\n            // check object selField is really bound\n            JavaSDM.ensure ( selField != null );\n            // check link selectedField from this to selField\n            JavaSDM.ensure (selField.equals (this.getSelectedField ()));\n\n            // destroy link\n            org.moflon.util.eMoflonEMFUtil.removeOppositeReference(this,selField,\"selectedField\");\n            fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n\n      }\n      else\n      {\n         // story pattern ActivityNode8\n         try \n         {\n            fujaba__Success = false; \n\n            // check object field is really bound\n            JavaSDM.ensure ( field != null );\n            // bind object\n            figure = field.getFigure ();\n\n            // check object figure is really bound\n            JavaSDM.ensure ( figure != null );\n\n\n            fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n         // story pattern ActivityNode9\n         try \n         {\n            fujaba__Success = false; \n\n            // check object field is really bound\n            JavaSDM.ensure ( field != null );\n            // create link\n            org.moflon.util.eMoflonEMFUtil.addOppositeReference(this,field,\"selectedField\");\n            fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n\n      }\n      return this;'"
	 * @generated
	 */
	Board fieldSelected(Field field);

} // Board
